﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DialogBoxes.aspx.cs" Inherits="Triad.Web.Views.Examples.DialogBoxes" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Dialog Box examples</title>
    <script type="text/javascript">
       
        // simple wrapper function
        function showNotification(nType, sText) {
            TF.APP.Common.cShowError(sText, nType, null);
        }
        
        // simple wrapper function
        function showConfirmationBox(sTitle, sQuest, eType) {
            ///    msgboxType: [None=0,ok=1, yes=2, yesno=3, yesnocancel=4],
            _TF.APP.Main.showMsgBox('cTst', sTitle, sQuest, eType, null, null);
        }
        
        // built-in event raised when confirmation box is closed
        function cTst_OnClose(answer) {
            alert('You clicked on: '+ answer);
        }

        function OpenDialog() {
            //_TF.APP.Main.openDialog = function(url, returnFunc, width, height, strTitle, retFocus) {
            _TF.APP.Main.openDialog('Views/Examples/DialogBoxes_hlp.htm',null,'60%',400,'Example URL Open Dialog', null);
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="formMain" runat="server">
    <div class="roundbox">
        <table style="width:100%;text-align:center">
            <tr>
                <td colspan="3" style=""><h2>Notification Boxes</h2></td>
            </tr>
            <tr>
                <td>
                    <input id="btnCSError" type="button" value="ClientSide Error" onclick="javascript:showNotification(1,'Client Side Error - should go away 4 seconds after next postback (or X button).');" /></td>
                <td>
                    <input id="btnCSWarn" type="button" value="ClientSide Warning" onclick="javascript:showNotification(2,'Client Side Warning - should go away 4 seconds after next postback (or X button).');" /></td>
                <td>
                    <input id="btnCSInfo" type="button" value="ClientSide Information" onclick="javascript:showNotification(3,'Client Side Informational Message - should go away in 5 seconds');" /></td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnSSError" runat="server" Text="ServerSide Error" onclick="btnSSError_Click" />
                </td>
                <td>
                    <asp:Button ID="btnSSWarn" runat="server" Text="ServerSide Warn" onclick="btnSSWarn_Click" />
                </td>
                <td>
                    <asp:Button ID="btnSSInfo" runat="server" Text="ServerSide Information" onclick="btnSSInfo_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div class="roundbox">
        <table style="width:100%;text-align:center">
            <tr>
                <td colspan="3" style=""><h2>Confirmation Boxes</h2></td>
            </tr>
            <tr>
                <td>
                    <input id="btnCSConfirmOk" type="button" value="ClientSide Confirm (OK)" onclick="javascript:showConfirmationBox('OK Confirmation', 'Ok to continue?', 1);" /></td>
                <td>
                    <input id="btnCSConfirmYesNo" type="button" value="ClientSide Confirm (YesNo)" onclick="javascript:showConfirmationBox('Yes/No Confirmation', 'Are you sure?', 3);" /></td>
                <td>
                    <input id="btnCSConfirmYesNoCancel" type="button" value="ClientSide Confirm (YesNoCancel)" onclick="javascript:showConfirmationBox('Yes/No/Cancel Confirmation', 'Do you wish to save before exiting?', 4);" /></td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="Button7" runat="server" Text="ServerSide Error" onclick="btnSSError_Click" />
                </td>
                <td>
                    <asp:Button ID="Button8" runat="server" Text="ServerSide Warn" onclick="btnSSWarn_Click" />
                </td>
                <td>
                    <asp:Button ID="Button9" runat="server" Text="ServerSide Information" onclick="btnSSInfo_Click" />
                </td>
            </tr>
        </table>
    </div>

    <div class="roundbox">
        <table style="width:100%;text-align:center">
            <tr>
                <td colspan="3" style=""><h2>Dialog Boxes</h2></td>
            </tr>
            <tr>
                <td>
                    <input id="btnCSDialog1" type="button" value="ClientSide popup(HTML)" onclick="javascript:OpenDialog();" /></td>
                <td>
                    <input id="btnCSDialog2" type="button" value="ClientSide popup(URL)" onclick="javascript:showNotification(2,'Client Side Warning - should go away 4 seconds after next postback (or X button).');" /></td>
                <td>
                    <input id="btnCSDialog3" type="button" value="ClientSide popup(Modal)" onclick="javascript:showNotification(3,'Client Side Informational Message - should go away in 5 seconds');" /></td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="Button4" runat="server" Text="ServerSide Error" onclick="btnSSError_Click" />
                </td>
                <td>
                    <asp:Button ID="Button5" runat="server" Text="ServerSide Warn" onclick="btnSSWarn_Click" />
                </td>
                <td>
                    <asp:Button ID="Button6" runat="server" Text="ServerSide Information" onclick="btnSSInfo_Click" />
                </td>
            </tr>
        </table>    
    </div>
    </form>
</body>
</html>
